import request from '@/router/axios';

export const getPlainConfigList = (current, size, params) => {
  return request({
    url: '/api/mes-product/qms-inspection-planconfig/page',
    method: 'post',
    data: {
      ...params,
      query: {
        current,
        size
      }
    }
  });
};

// 生成编码
export const getPlanCode = (params) => {
  return request({
    url: '/api/mes-product/qms-inspection-planconfig/gen-inspect-plan-no',
    method: 'get'
  });
};

// 启 停 计划配置
export const openAndCloseConfig = (id) => {
  return request({
    url: '/api/mes-product/qms-inspection-planconfig/update-status',
    method: 'get',
    params: {
      id
    }
  });
};

// 保存计划配置
export const savePlanConfig = (data) => {
  return request({
    url: '/api/mes-product/qms-inspection-planconfig/submit',
    method: 'post',
    data
  });
};

// 删除计划配置
export const removePlanConfig = (params) => {
  return request({
    url: '/api/mes-product/qms-inspection-planconfig/remove',
    method: 'post',
    params: {
      ...params
    }
  });
};

// 获取计划配置详情

export const getPlanConfigDetail = (params) => {
  return request({
    url: '/api/mes-product/qms-inspection-planconfig/detail',
    method: 'get',
    params: {
      ...params
    }
  });
};
